home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / clang / netclb23.zip / IPXSPX.H < prev    next >
C/C++ Source or Header  |  1994-05-20  |  5KB  |  132 lines

  1. #ifndef IPXSPX_H
  2. #define IPXSPX_H
  3.  
  4. /*********************************/
  5. /* Sort out compiler differences */
  6. /*********************************/
  7.  
  8. #ifdef TURBOC
  9. #define _far far
  10. #endif
  11.  
  12. /*******************/
  13. /* Data Structures */
  14. /*******************/
  15.  
  16. typedef struct {
  17.                  byte   network_number[4];
  18.                  byte   node_address[6];
  19.         } INTER_NETWORK_ADDR;
  20.  
  21. typedef struct {
  22.                  INTER_NETWORK_ADDR ina;
  23.                  nw_int             socket_number;
  24.         } NETWORK_ADDR;
  25.  
  26. typedef struct {
  27.                  void _far  *address;
  28.                  word       length;
  29.         } ECB_FRAGMENT;
  30.  
  31. /*********************/
  32. /* IPX Packet Header */
  33. /*********************/
  34.  
  35. typedef struct {
  36.                  nw_int        checksum;
  37.                  nw_int        length;
  38.                  byte          transport_control;
  39.                  byte          packet_type;           /* User Sets */
  40.                  NETWORK_ADDR  dest_addr;             /* User Sets */
  41.                  NETWORK_ADDR  srce_addr;
  42.         } IPX_HEADER;
  43.  
  44. /*********************/
  45. /* SPX Packet Header */
  46. /*********************/
  47.  
  48. typedef struct {
  49.                  IPX_HEADER    ipx;
  50.                  byte          connection_control;
  51.                  byte          datastream_type;       /* User Sets */
  52.                  nw_int        source_connection_id;
  53.                  nw_int        dest_connection_id;
  54.                  nw_int        sequence_number;
  55.                  nw_int        acknowledge_number;
  56.                  nw_int        allocation_number;
  57.         } SPX_HEADER;
  58.  
  59. /*****************************/
  60. /* Event Control Block (ECB) */
  61. /*****************************/
  62.  
  63. typedef struct {
  64.                  void _far     *link_address;
  65.                  void          (_far *esr)(void);     /* User Sets */
  66.                  byte          in_use;
  67.                  byte          completion_code;
  68.                  nw_int        socket_number;         /* User Sets */
  69.                  byte          IPX_workspace[4];
  70.                  byte          driver_workspace[12];
  71.                  byte          immediate_address[6];  /* User Sets */
  72.                  word          fragment_count;        /* User Sets */
  73.                  ECB_FRAGMENT  fragment[2];           /* User Sets */
  74.         } EVENT_CONTROL_BLOCK;
  75.  
  76. /******************************/
  77. /* SPX Connection status data */
  78. /******************************/
  79.  
  80. typedef struct { byte   connection_state;
  81.                  byte   watchdog_is_on;
  82.                  nw_int local_connection_id;
  83.                  nw_int remote_connection_id;
  84.                  nw_int sequence_number;
  85.                  nw_int local_acknowledge_number;
  86.                  nw_int local_allocation_number;
  87.                  nw_int remote_acknowledge_number;
  88.                  nw_int remote_allocation_number;
  89.                  nw_int local_socket;
  90.                  byte   immediate_address[6];
  91.                  byte   network_number[4];
  92.                  byte   node_address[6];
  93.                  nw_int socket;
  94.                  nw_int retransmission_count;
  95.                  nw_int est_roundtrip_delay;
  96.                  nw_int retransmitted_packets;
  97.                  nw_int suppressed_packets;
  98.         } SPX_CONNECTION_STATUS;
  99.  
  100. /***********************/
  101. /* Function prototypes */
  102. /***********************/
  103.  
  104. word IPXCancelEvent( EVENT_CONTROL_BLOCK *ecb );
  105. void IPXCloseSocket( word socketNumber );
  106. void IPXDisconnectFromTarget( NETWORK_ADDR *networkAddress );
  107. void IPXGetInternetworkAddress( INTER_NETWORK_ADDR *networkAddress );
  108. word IPXGetIntervalMarker( void );
  109. word IPXGetLocalTarget( INTER_NETWORK_ADDR *networkAddress ,
  110.                         byte *immediateAddress,word *transportTime );
  111. word IPXInitialise( void );
  112. word IPXListenForPacket( EVENT_CONTROL_BLOCK *ecb );
  113. word IPXOpenSocket( word *socketNumber, byte longevity );
  114. void IPXRelinquishControl( void );
  115. void IPXScheduleIPXEvent( EVENT_CONTROL_BLOCK *ecb , word delayTicks );
  116. void IPXSendPacket( EVENT_CONTROL_BLOCK *ecb );
  117.  
  118. void SPXAbortConnection( word connectionID );
  119. word SPXEstablishConnection( word retryCount, word watchdogFlag ,
  120.                    EVENT_CONTROL_BLOCK *ecb ,word *connectionID );
  121. word SPXGetConnectionStatus( word connectionID ,
  122.                              SPX_CONNECTION_STATUS *connectionStatus );
  123. int SPXInitialise( byte *majorVersion,byte *minorVersion,
  124.                    word *maxConnections,word *availableConnections );
  125. void SPXListenForConnection( word retryCount, word watchdogFlag ,
  126.                              EVENT_CONTROL_BLOCK *ecb );
  127. void SPXListenForSequencedPacket( EVENT_CONTROL_BLOCK *ecb );
  128. void SPXSendSequencedPacket( word connectionID, EVENT_CONTROL_BLOCK *ecb );
  129. void SPXTerminateConnection( word connectionID, EVENT_CONTROL_BLOCK *ecb );
  130.  
  131. #endif       /* IPXSPX_H */
  132.